package logger

// moduleConfig configuration for a single module's logging
type moduleConfig struct {
	Level      string `mapstructure:"level"`
	Name       string `mapstructure:"name"`
	MaxAge     int    `mapstructure:"maxAge"`
	MaxSize    int    `mapstructure:"maxSize"`
	MaxBackups int    `mapstructure:"maxBackups"`
	Compress   bool   `mapstructure:"compress"`
}

// LogConfig logging configuration for the entire application
type LogConfig struct {
	Default moduleConfig            `mapstructure:"default"`
	Modules map[string]moduleConfig `mapstructure:"modules"`
}

// DefaultConfig returns default configuration
func DefaultConfig() LogConfig {
	return LogConfig{
		Default: moduleConfig{
			Level:      "info",
			Name:       "app.log",
			MaxAge:     7,
			MaxSize:    100,
			MaxBackups: 10,
			Compress:   false,
		},
		Modules: make(map[string]moduleConfig),
	}
}
